package cn.test;

import cn.bb.entity.Computer;
import cn.bb.entity2.Printer;
import cn.bb.entity5.Company;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {
    public ApplicationContext app = null;
    @Before
    public void init(){
        app = new ClassPathXmlApplicationContext("applicationContext.xml");
    }
    @Test
    public void test1(){
        Computer computer = app.getBean("computer", Computer.class);
        computer.printsss();
    }
    @Test
    public void test2(){
        Printer printer = app.getBean("pri",Printer.class);
        printer.printerInfo();
    }
    @Test
    public void test3(){
        Company com = app.getBean("maps",Company.class);
        com.printInfo();
    }
}
